package com.heima.wemedia.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.wemedia.dtos.WmNewsReviewDTO;
import com.heima.model.wemedia.pojos.WmNews;
import com.heima.model.wemedia.vos.WmNewsReviewVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface WmNewsMapper extends BaseMapper<WmNews> {

    /**
     * 批量保存文章与素材的关联关系
     * @param vmMaterialIds 所有引用素材的 ID
     * @param newsId    文章 ID
     * @param type  引用类型：【0 - 文章封面引用】【1 - 文章内容引用】
     */
    public void batchSaveRelation(@Param("wmMaterialIds")List<Integer> vmMaterialIds,
                                  @Param("newsId") Integer newsId,
                                  @Param("type") Short type);

    public List<WmNewsReviewVO> findWmNewsByStatus(@Param("wmNewsReviewDTO")WmNewsReviewDTO wmNewsReviewDTO);

    public Long findCountByStatus(@Param("wmNewsReviewDTO") WmNewsReviewDTO wmNewsReviewDTO);
}
